<?php

namespace App\Modules\Core\Providers;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Http\Resources\Json\Resource;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //Resource::withoutWrapping();
        Schema::defaultStringLength(191);

        //视图共享数据
        //View::share('name', 'frans');


        /**
         * 监听SQL
         */
//        DB::listen(function ($query) {
//            info('__SQL : ' . $query->sql);
//            info('__SQL_BIND : ' . json_encode($query->bindings));
//            info('__SQL_TIME : ' . $query->time . 's');
//        });


    }
}
